<template>
  <div>
    <h1>抽奖记录表</h1>
  </div>
  <div>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="recordId" label="Date" width="180" />
      <el-table-column prop="userId" label="用户id" width="180" />
      <el-table-column prop="userName" label="用户名称" width="180" />
      <el-table-column prop="userMobile" label="手机号" width="180" />
      <el-table-column prop="activeType" label="活动类型" width="180" />
      <el-table-column prop="winFlag" label="中奖名单" width="180">
        <template #default="scope">
          <span v-if="scope.row.winRecord == 0">公开</span>
          <span v-if="scope.row.winRecord == 1">不公开</span>
        </template>
      </el-table-column>
      <el-table-column prop="ruleId" label="规则id" width="180" />
      <el-table-column prop="recordDesc" label="规则详情" width="180" />
      <el-table-column prop="createBy" label="创建人" width="180" />
      <el-table-column label="操作" />
    </el-table>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";
const searchForm = ref({
  pageSize: 3,
  pageNum: 1,
  keyWord: "",
});
import { getRecord } from "@/api/api";
import { ElMessage } from "element-plus";
const tableData = ref([]);
const loadListy = () => {
  getRecord(searchForm.value).then((res) => {
    if (res.data.code == 200) {
      ElMessage.success("展示成功");
      tableData.value = res.data.data.records;
    } else {
      ElMessage.error(res.data.msg);
    }
  });
};
//  if ((res.data.code = 200)) {
//       ElMessage.success("展示成功");
//       tableData.value=res.data.da
//     } else {
//       ElMessage.error(res.data.msg);
//     }

onMounted(() => {
  loadListy();
});
</script>

<style scoped></style>
